<template>
  <div id="details">
    <app-header/>
    <div class="notice-main">
      <div class="notice-title" v-if="notice">{{notice.title}}</div>
      <div class="notice-detail">
        <div v-if="detailData&&detailData.content" v-html="detailData.content"></div>
      </div>
    </div>
  </div>
</template>

<script>
  import {Toast} from 'vant'
  import Header from '@/components/component/header.vue'
  import Api from '@/axios'

  export default {
    name: 'detail',
    data() {
      return {
        detailData: null
      }
    },
    components: {
      'app-header': Header
    },
    methods: {
      getDatail() {
        let parma = {
          id: this.$route.query.id
        }
        Api.topicDetail(parma).then(res => {
          let result = res.data
          if (result.code === 0) {
            this.detailData = result.data
          }
        })
      }
    },
    mounted() {
      this.getDatail()
    }
  }
</script>

<style lang="less" scoped>
  #details {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 94px;
    box-sizing: border-box;
    .notice-main {
      width: 100%;
      height: auto;
      display: block;
      overflow: hidden;
      margin: 0 auto;
      padding: 30px 24px;
      box-sizing: border-box;
      background: #020C47;
      .notice-title {
        width: 100%;
        height: 56px;
        background: #3200A6;
        line-height: 56px;
        font-size: 24px;
        color: #FFFFFF;
        text-align: center;
      }
      .notice-detail {
        width: 100%;
        height: auto;
        display: block;
        overflow: hidden;
        font-size: 24px;
        color: #FFFFFF;
        line-height: 38px;
        text-align: left;
      }
    }
  }
</style>
